SPB Git forge
38commits 1branches 0releases
338.7 MBsize
maindefault branch
7 h agolast push
HTML 53.9% TypeScript 44.5% JavaScript 0.6% SQL 0.5%
711 B · 16 lines tsx
Raw Blame History
1import { notFound } from "next/navigation";2import type { ReactNode } from "react";3import { getFacility } from "./data";45/**6 * Existence gate for /datacenters/[slug]: the API answers 404 for unknown (or merged-away) slugs, so the segment7 * layout resolves the record before any loading boundary of this segment renders — a real 404, not a soft one.8 * Other API failures fall through to the page, which renders an offline state.9 */10export default async function FacilityLayout({ children, params }: { children: ReactNode; params: Promise<{ slug: string }> }) {11  const { slug } = await params;12  const r = await getFacility(slug);13  if (!r.ok && r.status === 404) notFound();14  return <>{children}</>;15}16